'''
1.0.0 版本 
# Date: 2024/12/28
# Author: ZHENG
# Description:
    # 此版本功能如下：
        1. 在主界面中添加一个按钮，点击按钮后弹出百度地图界面

'''

# -*- coding: utf-8 -*-
import sys
from PyQt5.QtCore import QUrl
from PyQt5.QtWidgets import QApplication, QWidget, QVBoxLayout
from PyQt5.QtWebEngineWidgets import QWebEngineView

class rvizWindow(QWidget):
    def __init__(self, frame_middle=None):
        # super().__init__()
        super().__init__(frame_middle)
        self.browser = QWebEngineView()
        self.browser.setUrl(QUrl("https://map.baidu.com/@13192196,3662847,13z"))
        
        # self.browser.setUrl(QUrl("https://cn.bing.com/"))

        # self.setCentralWidget(self.browser)
        # self.showMaximized()
        
        layout = QVBoxLayout(self)
        layout.addWidget(self.browser)
        self.setLayout(layout)

    def navigate_to_url(self):
        url = self.url_bar.text()
        self.browser.setUrl(QUrl(url))

if __name__ == '__main__':
    app = QApplication(sys.argv)
    QApplication.setApplicationName('Maps with PyQt5')
    window = rvizWindow()
    app.exec_()